//
// Created by Administrator on 2023/5/9.
//
#include <stdint.h>
#ifndef NEXRINGAPPOPENSOURCE_OEM_AUTH_H
#define NEXRINGAPPOPENSOURCE_OEM_AUTH_H


typedef enum _RESULT {
    SUCCESS = 0,
    ERROR = 1,
} RESULT_T;
typedef enum _AES_KEY_BITS {
    AES_128 = 128,
    AES_256 = 256,
} AES_KEY_BITS;

int aes128_encrypt(char *sn,
                   size_t sn_size,
                   char *company,
                   size_t company_size,
                   char *data,
                   size_t data_size,
                   char *out,
                   size_t out_size);

int aes128_decrypt(char *sn,
                   size_t sn_size,
                   char *company,
                   size_t company_size,
                   char *data,
                   size_t data_size,
                   char *out);

void get_key(char *sn,
             size_t sn_size,
             char *company,
             size_t company_size,
             char out_key[16]);
void printHex(char *tag, char *s, int l);

#endif //NEXRINGAPPOPENSOURCE_OEM_AUTH_H


